home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////////////////////////////////////////////////////// //
- // $Id: StatInfo.hxx,v 1.2 1994/09/13 23:23:17 bmott Exp $
- /////////////////////////////////////////////////////////////////////////////// //
- //
- // StatInfo.hxx
- //
- // This class is used by BasicCPU (and derived classes) to manage a list of
- // of statistics objects.
- //
- //
- // BSVC "A Microprocessor Simulation Framework"
- // Copyright (c) 1993
- // By: Bradford W. Mott
- // December 5,1993
- //
- ///////////////////////////////////////////////////////////////////////////////
- // $Log: StatInfo.hxx,v $
- // Revision 1.2 1994/09/13 23:23:17 bmott
- // Added public to class declaration of StatisticInformationNode.
- //
- // Revision 1.1 1994/02/18 19:53:49 bmott
- // Initial revision
- //
- ///////////////////////////////////////////////////////////////////////////////
-
- #ifndef STATINFO_HXX
- #define STATINFO_HXX
-
- #include "BasicCPU.hxx"
-
- ///////////////////////////////////////////////////////////////////////////////
- // The Statistic Information Class
- ///////////////////////////////////////////////////////////////////////////////
- class StatisticInformation {
- private:
- char *statistic; // The statistic (i.e. "Number of reads: 100")
-
- public:
- StatisticInformation(const char* statistic);
- StatisticInformation();
- ~StatisticInformation();
-
- // Set the statistic fields
- void Set(const char* statistic);
-
- inline const char* Statistic()
- { return(statistic); }
- };
-
-
- ///////////////////////////////////////////////////////////////////////////////
- // The Statistical Information List Class
- ///////////////////////////////////////////////////////////////////////////////
- class StatisticalInformationList {
- private:
- // Class for a linked list of StatisticInformation structures
- class StatisticInformationNode : public StatisticInformation {
- public:
- StatisticInformationNode* next;
-
- StatisticInformationNode(const char* statistic)
- : StatisticInformation(statistic),
- next((void*)0)
- { };
- };
-
- StatisticInformationNode* head; // Head of the linked list
- StatisticInformationNode* tail; // Tail of the linked list
- int number_of_elements; // Number of elements in the list
-
- public:
- StatisticalInformationList(BasicCPU*);
- ~StatisticalInformationList();
-
- // Append an element to the end of the list
- void Append(const char* statistic);
-
- // Return the number of elements in the list
- inline int NumberOfElements()
- { return(number_of_elements); }
-
- // Get the element with the given index (return 1=OK,0=ERROR)
- int Element(int, StatisticInformation&);
- };
- #endif
-